package org.dulong.dao.impl;

import org.dulong.dao.IDao;

import java.util.Calendar;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 13-9-23
 * Time: 上午10:07
 * To change this template use File | Settings | File Templates.
 */
public class IDaoImpl implements IDao {
    @Override
    public String sayHello(String name) {
        int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
        if (hour < 6) return "凌晨好," + name;
        if (hour < 12) return "早上好," + name;
        if (hour < 18) return "下午好," + name;
        return "晚上好," + name;
    }
}
